<!-- 导航栏组件：pNavbar -->
<template>
	<view class="nav-body">
		<u-navbar v-bind="$attrs" v-on="$listeners" :title="title" :placeholder="true" :bgColor="bgColor"
			@leftClick="leftClick" @rightClick="rightClick" :titleStyle="titleStyle" :autoBack="autoBack">
			<view class="u-nav-slot" slot="left">
				<slot name="left">
					<u-icon name="list" color="#FFFFFF" size="28rpx"></u-icon>
				</slot>
			</view>
			<view class="u-nav-slot" slot="right">
				<slot name="right">
					<u-icon name="more-dot-fill" color="#FFFFFF" size="28rpx"></u-icon>
				</slot>
			</view>
		</u-navbar>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: '地下水环境调查终端'
			},
			bgColor: {
				type: String,
				default: '#555555'
			},
			// 标题的样式，对象形式
			titleStyle: {
				type: Object,
				default: () => ({
					color: 'white',
					fontSize: '25rpx',
					fontWeight: 600
				})
			},
			autoBack: {
				type: Boolean,
				default: false,
			}
		},
		data() {
			return {}
		},
		methods: {
			rightClick() {
				console.log('rightClick');
			},
			leftClick() {
				console.log('leftClick');
			}
		}
	}
</script>

<style lang="scss" scoped>
	.nav-body {}
</style>